/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mygame.objects;

import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue.ShadowMode;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import mygame.Game;

/**
 * Abstract class with base functionality for objects
 * that are rendered to screen.
 * @author Matthias
 */
public abstract class Object {

	private Vector3f position;
	protected Node sceneNode;

	public Object(Vector3f position) {
		sceneNode = new Node("" + position);
		sceneNode.setShadowMode(ShadowMode.CastAndReceive);
		Spatial loadModel = Game.getInstance().
						getAssetManager().loadModel("Models/" + getMeshName());
		sceneNode.attachChild(loadModel);
		Game.getInstance().getRootNode().attachChild(sceneNode);
		sceneNode.setLocalTranslation(position);

		// TODO: maybe we want to register the nodes in some object manager.
		// maybe we dont.
	}

	abstract String getMeshName();
}
